package com.t17;

import java.util.ArrayList;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;

/**
 * Created by xuyiwei on 2018/8/26.
 */
public class FailFast {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        Iterator<String> it = c.iterator();
        c.add("An object");
        try{
            String s = it.next();
        }catch (ConcurrentModificationException e){
            System.out.println(e);
        }
        //java.util.ConcurrentModificationException
    }
}
